<%@page isELIgnored="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<c:set var="fieldRequired"><spring:message code="validation.field.required"/></c:set>
<c:set var="emailInvalid"><spring:message code="validation.email.invalid"/></c:set>
<c:set var="emailTaken"><spring:message code="validation.email.taken"/></c:set>

<script type="text/javascript">
	$().ready(function() {
		$("#createNewCourse").validate({
			rules : {
				title : {
					required: true
				},
				description : {
					required: true
				}
			},
			messages : {
				title: {
					required: "${fieldRequired}"
				},
				description : {
					required: "${fieldRequired}"
				}
			}
		});		
	});
</script>

<div style="padding:10px">
	<div id="form">
		<span class="title"><spring:message code="create.course.title"/></span>
		<form:form method="post" commandName="course" id="createNewCourse" name="createNewCourse" action="${formURL}" enctype="multipart/form-data">
			<table class="tableForm">
				<tr>
					<td><label><spring:message code="form.course.title"/></label></td>
					<td><form:input path="title" id="title" size="23"/></td>
				</tr>
				<tr>
					<td valign="top" style="padding-top:5px; width: 83px;"><label><spring:message code="form.course.description"/></label></td>
					<td><form:textarea path="description" id="description" style="width:170px;height:90px"/></td>
				</tr>
				<tr>
					<td><label><spring:message code="form.course.program"/></label></td>
					<td><input type="file" id="program" size="11" name="program"/></td>
				</tr>
				<tr><td colspan="2" style="padding-left: 185px;"><input name="submit" type="submit" value="<spring:message code='create.button'/>"/></td></tr>
				<tr><td colspan="2"><div id="line" style="width: 260px"></div></td></tr>			
				<tr><td colspan="2"><span class="footnote">(*) - <spring:message code="fields.optional"/></span></td></tr>
			</table>
			
		</form:form>
	</div>
	
</div>